package com.dyj.common.enums;

public enum DyTikTokPathEnum {

    /**
     * 域名
     */
    DOMAIN("tikTokDomain", "https://open.tiktokapis.com/v2"),
    /**
     * 获取 access_token
     */
    OAUTH_ACCESS_TOKEN("tikTokOauthAccessToken", "/oauth/token/"),

    /**
     * 用户信息
     */
    USER_INFO("tikTokUserInfo", "/user/info/"),

    /**
     * 查询视频列表
     */
    QUERY_VIDEO_LIST("tikTokQueryVideoList", "/video/list/"),

    /**
     * 初始化上传视频
     */
    INIT_UPLOAD_VIDEO("tikTokInitUploadVideo", "/post/publish/inbox/video/init/"),

    /**
     * 上传图片
     */
    UPLOAD_IMAGE("tikTokUploadImage", "/post/publish/content/init/"),

    QUERY_POST_STATUS("tikTokQueryPostStatus", "/post/publish/status/fetch/");

    private String key;
    private String value;

    DyTikTokPathEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public static String getValueByKey(String key) {
        for (DyWebUrlPathEnum e : DyWebUrlPathEnum.values()) {
            if (e.getKey().equals(key)) {
                return e.getValue();
            }
        }
        return null;
    }
}
